/**
 * JungoMobileWeb
 * ThumbnailUtil.java
 * 
 * Copyright 2013 Teachizen
 * Written by cloudstick
 *	2013. 8. 6. first written.
 *
 * note:
 */
package com.jungo.web.util;

import java.io.IOException;

import net.coobird.thumbnailator.Thumbnails;

/**
 * @author cloudstick
 *
 */
public class ThumbnailUtil {
	
	private static final int DEFAULT_WIDTH = 100;
	private static final int DEFAULT_HEIGHT = 80;
	
	public static void makeThumbnail(String src, String dst) {
		makeThumbnail(src, dst, DEFAULT_WIDTH, DEFAULT_HEIGHT);
	}
	
	public static void makeThumbnail(String src, String dst, int width, int height) {
		try {
			Thumbnails.of(src).size(width, height).toFile(dst);
		} catch (IOException e) {
			throw new RuntimeException("Exception occured whiling make thumbnail image.", e);
		}
	}
}
